package com.boot.core.protocol

import com.boot.core.result.ResultTo
import org.springframework.web.bind.annotation.*
import org.springframework.web.client.RestTemplate

@ResponseBody
@RestController
@RequestMapping(value = ["/singleSignOnControl"])
@CrossOrigin
class SingleSignOnControl {


    /**
     * 统一认证票据验证接口
     * 1.验证结果flag：0验证通过，1票据信息过期，2票据信息验证未通过，3该票据信息不属于平台发放票据，4其它错误。
     */
    @GetMapping("/verifyBillUnify")
    fun verifyBillUnify(strBill: String): ResultTo {
        val URL: String = "http:/20.80.4.141:15002/uas/sso/singlesignoncontrol/ checkbill.do?strBill="
        var restTemplate = RestTemplate()
        var resultVeriry: Any = restTemplate.getForObject((URL+strBill), HashMap::class.java) as Any
        return ResultTo().setData("resultVeriry", resultVeriry)
    }


}